{% extends "root/_incs/lay_root.htm" %}

{% block title %}
<title>微爬(fang.com)采集 - {{ g.sys['title']}}</title>
<meta name='robots' content='noindex, nofollow'>
{% endblock %}

{% block head %}
    <h1>自定义 - DIY爬</h1>
    <p> 自定义采集页面元素，我怎么感觉在用JQ？对，这里用PyQuery！</p>
{% endblock %}

{% block main %}

<div class="out">

<div class="in">
    <h2><span class="tg1"><a href="./pa">返回</a></span>采集配置</h2>
    <div>
        <p class="tc">
        <a href="?url=http://news.baidu.com/&s1st=div&s2nd=li&satt=">news.baidu.com</a> - 
        <a href="?url=http://dg.fzg360.com/&s1st=.veditor&s2nd=li&satt=">dg.fzg360.com</a> - 
        <a href="?url=http://www.08cms.com/html/service/&s1st=.item&s2nd=.middbox&satt=">www.08cms.com</a> - 
        <a href="?url=http://txmao.txjia.com/dev.php&s1st=ul&s2nd=li&satt=">txmao.txjia.com</a>
        </p>
        <p>URL地址 ： 
        <a href="{{ d.data.url }}" target="_blank">{{ d.data.url }}</a>
        </p>
        <p>
            <form name="fms1" method="get" action="?">
                <input type="text" name="url" value="{{ d.data.url }}" placeholder="url" style="width:99%">
                <br>
                <input disabled value="主选择器(如:`div`,`.class1`)" style="width:20%">
                <input disabled value="子选择器(如:`li`,`a`,`.cls2`)" style="width:20%"> 
                <input disabled value="属性(如:`html()`,`text()`,`href`,`data-pic`)" style="width:20%">
                <br>
                <input type="text" name="s1st" value="{{ d.data.s1st }}" placeholder="" style="width:20%">
                <input type="text" name="s2nd" value="{{ d.data.s2nd }}" placeholder="" style="width:20%">
                <input type="text" name="satt" value="{{ d.data.satt }}" placeholder="" style="width:20%">
                <input type="submit" name="submit" id="button" value="爬爬" style="width:60px">
            </form>
        </p>
    </div>
</div>

{% for key in d.data.res %}
<div class="in">
    <h2><span class="tg1">{{ d.data.res[key]|count() }}</span>{{ key }}</h2>
    <div>
        <p>
        {% for itm in d.data.res[key] %}
        {{ itm|safe }}, 
        {% endfor %}
        </p>
    </div>
</div>
{% endfor %}

</div><!--end.out-->

{% endblock %}
